-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /setup endpoint #223
Add /setup endpoint #223
Conversation
I would love if we can just do: (devices, places, gateways) = await client.get_setup() However, this is currently not supported:
Any ideas? |
self.devices = devices | ||
if self.setup: | ||
self.setup.devices = devices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So basically here, you don’t cache the devices, but sync with the /setup entry point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? What we do here is overwrite the /setup response with the latest devices response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK it’s what I can sync :D
By the way, do we use this feature (cache) somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tetienne not really I think, thus I was also thinking to remove it... However, it doesn't have a lot of extra code and can help other people to make sure they don't call expensive endpoints all the time. :-)
"location": { | ||
"creationTime": 1613674982000, | ||
"lastUpdateTime": 1632527573000, | ||
"city": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to have a "real" value to know what the data look like. Same remarks for all the * values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really matter? All * values are string values. I could replace the sensitive values with a placeholder, but since * is a string as well, I didn't bother.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like obfuscating more? So we keep the same amount of characters? I have the originals locally, so I can make changes to the regex. Currently I use the same regex as we use (in this PR) to obfuscate sensitive info in the logging.
Co-authored-by: Thibaut <thibaut@etienne.pw>
70acd61
to
283704c
Compare
* Add /setup endpoint * Update location class * Fix obfuscate id * Obfuscate id * Add mask feature * Add basic fixtures for /setup * Add basic tests * bugfix * Add local setup json * Add feature key * Update fixtures * Add better api doc * Type zone object * Add extra fixture * Update pyhoma/models.py Co-authored-by: Thibaut <thibaut@etienne.pw> * Refactor based on feedback * Fix style Co-authored-by: Thibaut <thibaut@etienne.pw>
get_devices
andget_gateways
)